#ifndef TEMPLATE_PATTERN_H
#define TEMPLATE_PATTERN_H

class Game
{
public:
    virtual ~Game() {}

    virtual void initialize() = 0;
    virtual void startPlay() = 0;
    virtual void endPlay() = 0;

    virtual void play() final;
};

class Cricket : public Game
{
public:
    ~Cricket() {}

    void endPlay() override;
    void startPlay() override;
    void initialize() override;
};


class Football : public Game
{
public:
    ~Football() {}

    void endPlay() override;
    void startPlay() override;
    void initialize() override;
};

#endif // TEMPLATE_PATTERN_H

/*
    Game* game = new Cricket();
    game->play();
    game = new Football();
    game->play();
    */
